package com.yicong.ants.bean.scenic;

import com.cchao.simplelib.util.StringHelper;
import com.yicong.ants.R;

import java.util.HashMap;
import java.util.Map;



/**
 * @author cchao
 * @version 2019-07-03.
 */

public class ScenicItem {

    /**
     * scenic_id : 1510
     * name : 胡雪岩故居
     * address : 浙江省杭州市上城区元宝街18号
     * longitude : 120.179464
     * latitude : 30.242971
     * thumbnail : http://zslyadmin.yytxlyw.com/Uploads/Picture/2018-09-05/d6f2208036b.jpg
     * short_description : 晚清红顶巨商胡雪岩的豪宅，极尽奢华的江南园林。
     * advance : 1
     * cate_name : 自然风光
     * level_name : 3A景区
     * distance : 4.239
     * passport_types : [1]
     * passport_type_name : [黄金版]
     */

    private String scenic_id;
    private String scenic_type;
    private String name;
    private String address;
    private String longitude;
    private String latitude;
    private String thumbnail;
    private String short_description;
    private int advance;
    private String cate_name;
    private String level_name;
    private String level_short_name;
    private double distance;
    private String passport_type_name;
    private String passport_type;
    private int scenicDrawable;

    public ScenicItem() {
    }

    public int getScenicDrawable() {
        if (StringHelper.isEmpty(passport_type)) {
            return R.drawable.scenic_list_ic_type4;
        }

        Map<String, Integer> map = new HashMap<>(4);
        map.put("1", R.drawable.scenic_list_ic_type1);
        map.put("2", R.drawable.scenic_list_ic_type2);

        for (Map.Entry<String, Integer> entry : map.entrySet()) {
            if (passport_type.contains(entry.getKey())) {
                return entry.getValue();
            }
        }
        return R.drawable.scenic_list_ic_type4;
    }

    public double getDistance() {
        return Double.parseDouble(String.format("%.1f",distance));
    }

    public String getScenic_id() {
        return this.scenic_id;
    }

    public String getScenic_type() {
        return this.scenic_type;
    }

    public String getName() {
        return this.name;
    }

    public String getAddress() {
        return this.address;
    }

    public String getLongitude() {
        return this.longitude;
    }

    public String getLatitude() {
        return this.latitude;
    }

    public String getThumbnail() {
        return this.thumbnail;
    }

    public String getShort_description() {
        return this.short_description;
    }

    public int getAdvance() {
        return this.advance;
    }

    public String getCate_name() {
        return this.cate_name;
    }

    public String getLevel_name() {
        return this.level_name;
    }

    public String getLevel_short_name() {
        return this.level_short_name;
    }

    public String getPassport_type_name() {
        return this.passport_type_name;
    }

    public String getPassport_type() {
        return this.passport_type;
    }

    public ScenicItem setScenic_id(String scenic_id) {
        this.scenic_id = scenic_id;
        return this;
    }

    public ScenicItem setScenic_type(String scenic_type) {
        this.scenic_type = scenic_type;
        return this;
    }

    public ScenicItem setName(String name) {
        this.name = name;
        return this;
    }

    public ScenicItem setAddress(String address) {
        this.address = address;
        return this;
    }

    public ScenicItem setLongitude(String longitude) {
        this.longitude = longitude;
        return this;
    }

    public ScenicItem setLatitude(String latitude) {
        this.latitude = latitude;
        return this;
    }

    public ScenicItem setThumbnail(String thumbnail) {
        this.thumbnail = thumbnail;
        return this;
    }

    public ScenicItem setShort_description(String short_description) {
        this.short_description = short_description;
        return this;
    }

    public ScenicItem setAdvance(int advance) {
        this.advance = advance;
        return this;
    }

    public ScenicItem setCate_name(String cate_name) {
        this.cate_name = cate_name;
        return this;
    }

    public ScenicItem setLevel_name(String level_name) {
        this.level_name = level_name;
        return this;
    }

    public ScenicItem setLevel_short_name(String level_short_name) {
        this.level_short_name = level_short_name;
        return this;
    }

    public ScenicItem setDistance(double distance) {
        this.distance = distance;
        return this;
    }

    public ScenicItem setPassport_type_name(String passport_type_name) {
        this.passport_type_name = passport_type_name;
        return this;
    }

    public ScenicItem setPassport_type(String passport_type) {
        this.passport_type = passport_type;
        return this;
    }

    public ScenicItem setScenicDrawable(int scenicDrawable) {
        this.scenicDrawable = scenicDrawable;
        return this;
    }

    public boolean equals(final Object o) {
        if (o == this) return true;
        if (!(o instanceof ScenicItem)) return false;
        final ScenicItem other = (ScenicItem) o;
        if (!other.canEqual((Object) this)) return false;
        final Object this$scenic_id = this.getScenic_id();
        final Object other$scenic_id = other.getScenic_id();
        if (this$scenic_id == null ? other$scenic_id != null : !this$scenic_id.equals(other$scenic_id))
            return false;
        final Object this$scenic_type = this.getScenic_type();
        final Object other$scenic_type = other.getScenic_type();
        if (this$scenic_type == null ? other$scenic_type != null : !this$scenic_type.equals(other$scenic_type))
            return false;
        final Object this$name = this.getName();
        final Object other$name = other.getName();
        if (this$name == null ? other$name != null : !this$name.equals(other$name)) return false;
        final Object this$address = this.getAddress();
        final Object other$address = other.getAddress();
        if (this$address == null ? other$address != null : !this$address.equals(other$address))
            return false;
        final Object this$longitude = this.getLongitude();
        final Object other$longitude = other.getLongitude();
        if (this$longitude == null ? other$longitude != null : !this$longitude.equals(other$longitude))
            return false;
        final Object this$latitude = this.getLatitude();
        final Object other$latitude = other.getLatitude();
        if (this$latitude == null ? other$latitude != null : !this$latitude.equals(other$latitude))
            return false;
        final Object this$thumbnail = this.getThumbnail();
        final Object other$thumbnail = other.getThumbnail();
        if (this$thumbnail == null ? other$thumbnail != null : !this$thumbnail.equals(other$thumbnail))
            return false;
        final Object this$short_description = this.getShort_description();
        final Object other$short_description = other.getShort_description();
        if (this$short_description == null ? other$short_description != null : !this$short_description.equals(other$short_description))
            return false;
        if (this.getAdvance() != other.getAdvance()) return false;
        final Object this$cate_name = this.getCate_name();
        final Object other$cate_name = other.getCate_name();
        if (this$cate_name == null ? other$cate_name != null : !this$cate_name.equals(other$cate_name))
            return false;
        final Object this$level_name = this.getLevel_name();
        final Object other$level_name = other.getLevel_name();
        if (this$level_name == null ? other$level_name != null : !this$level_name.equals(other$level_name))
            return false;
        final Object this$level_short_name = this.getLevel_short_name();
        final Object other$level_short_name = other.getLevel_short_name();
        if (this$level_short_name == null ? other$level_short_name != null : !this$level_short_name.equals(other$level_short_name))
            return false;
        if (Double.compare(this.getDistance(), other.getDistance()) != 0) return false;
        final Object this$passport_type_name = this.getPassport_type_name();
        final Object other$passport_type_name = other.getPassport_type_name();
        if (this$passport_type_name == null ? other$passport_type_name != null : !this$passport_type_name.equals(other$passport_type_name))
            return false;
        final Object this$passport_type = this.getPassport_type();
        final Object other$passport_type = other.getPassport_type();
        if (this$passport_type == null ? other$passport_type != null : !this$passport_type.equals(other$passport_type))
            return false;
        if (this.getScenicDrawable() != other.getScenicDrawable()) return false;
        return true;
    }

    protected boolean canEqual(final Object other) {
        return other instanceof ScenicItem;
    }

    public int hashCode() {
        final int PRIME = 59;
        int result = 1;
        final Object $scenic_id = this.getScenic_id();
        result = result * PRIME + ($scenic_id == null ? 43 : $scenic_id.hashCode());
        final Object $scenic_type = this.getScenic_type();
        result = result * PRIME + ($scenic_type == null ? 43 : $scenic_type.hashCode());
        final Object $name = this.getName();
        result = result * PRIME + ($name == null ? 43 : $name.hashCode());
        final Object $address = this.getAddress();
        result = result * PRIME + ($address == null ? 43 : $address.hashCode());
        final Object $longitude = this.getLongitude();
        result = result * PRIME + ($longitude == null ? 43 : $longitude.hashCode());
        final Object $latitude = this.getLatitude();
        result = result * PRIME + ($latitude == null ? 43 : $latitude.hashCode());
        final Object $thumbnail = this.getThumbnail();
        result = result * PRIME + ($thumbnail == null ? 43 : $thumbnail.hashCode());
        final Object $short_description = this.getShort_description();
        result = result * PRIME + ($short_description == null ? 43 : $short_description.hashCode());
        result = result * PRIME + this.getAdvance();
        final Object $cate_name = this.getCate_name();
        result = result * PRIME + ($cate_name == null ? 43 : $cate_name.hashCode());
        final Object $level_name = this.getLevel_name();
        result = result * PRIME + ($level_name == null ? 43 : $level_name.hashCode());
        final Object $level_short_name = this.getLevel_short_name();
        result = result * PRIME + ($level_short_name == null ? 43 : $level_short_name.hashCode());
        final long $distance = Double.doubleToLongBits(this.getDistance());
        result = result * PRIME + (int) ($distance >>> 32 ^ $distance);
        final Object $passport_type_name = this.getPassport_type_name();
        result = result * PRIME + ($passport_type_name == null ? 43 : $passport_type_name.hashCode());
        final Object $passport_type = this.getPassport_type();
        result = result * PRIME + ($passport_type == null ? 43 : $passport_type.hashCode());
        result = result * PRIME + this.getScenicDrawable();
        return result;
    }

    public String toString() {
        return "ScenicItem(scenic_id=" + this.getScenic_id() + ", scenic_type=" + this.getScenic_type() + ", name=" + this.getName() + ", address=" + this.getAddress() + ", longitude=" + this.getLongitude() + ", latitude=" + this.getLatitude() + ", thumbnail=" + this.getThumbnail() + ", short_description=" + this.getShort_description() + ", advance=" + this.getAdvance() + ", cate_name=" + this.getCate_name() + ", level_name=" + this.getLevel_name() + ", level_short_name=" + this.getLevel_short_name() + ", distance=" + this.getDistance() + ", passport_type_name=" + this.getPassport_type_name() + ", passport_type=" + this.getPassport_type() + ", scenicDrawable=" + this.getScenicDrawable() + ")";
    }
}
